//
//  RecordCell.m
//  MoneyLog
//
//  Created by Max on 11-3-1.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "RecordCell.h"
#import "RecordView.h"
#import "RecordWrapper.h"

@implementation RecordCell

@synthesize recordView;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	if (self == [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
		
		// Create a time record view and add it as a subview of self's contentView.
		CGRect tzvFrame = CGRectMake(0.0, 0.0, self.contentView.bounds.size.width, self.contentView.bounds.size.height);
		recordView = [[RecordView alloc] initWithFrame:tzvFrame];
		recordView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
		[self.contentView addSubview:recordView];
	}
	return self;	
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state.
}

-(void) setRecordWrapper:(RecordWrapper *) recordWrapper{
	[recordView setRecordWrapper:recordWrapper];
}

- (void)redisplay {
	[recordView setNeedsDisplay];
}

- (void)dealloc {
	[recordView release];
    [super dealloc];
}


@end
